<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>部门积分管理</title>
<link rel="stylesheet" href="__CSS__/pintuer.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/admin.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/responsive.css?v={$src_version}">
<script src="__JS__/jquery-3.2.1.min.js?v={$src_version}"></script>
<script src="__JS__/pintuer.js?v={$src_version}"></script>
<script src="__JS__/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/layer.js?v={$src_version}"></script>
<script src="__JS__/ming.js?v={$src_version}"></script>
<script src="__JS__/responsive.js?v={$src_version}"></script>
</head>
<body>
<div class="panel admin-panel">	
	<a class="button border-yellow" href="{:U('Integral/AddCategory',array('branch_id'=>$branch_id))}" >
		<span class="icon-plus-square-o"></span>
		添加积分项目
	</a>
	<select id="branch">
		<option value="0">请选择部门</option>
		<volist name="branches" id="vo">
			<option value="{$vo.id}">{$vo.brank_name}</option>
		</volist>
	</select>
	<table class="table table-hover text-center table-one">
		<tr>
			<th>名称</th>
			<th>部门</th>
			<th>项目类型</th>
			<th>分数</th>
			<th>操作</th>
		</tr>
		<volist name="list" id="vo2" key="j">
					<tr>
						<td>{$vo2.category_name}</td>
						<td>{$vo2.brank_name}</td>
						<td><if condition="$vo2.opt eq '+'">加分项目<else/>减分项目</if></td>
						<td><span>分数区间：</span>{$vo2.min_jifen}~{$vo2.max_jifen}</td>
						<td>
							<a class="button border-main" href="{:U('Integral/EditCategory',array('category_id'=>$vo2['id']))}">
								<span class="icon-edit"></span>修改
							</a>
							<a class="button border-red del" href="javascript:;" data-href="{:U('Integral/DelCategory',array('category_id'=>$vo2['id']))}" >
								<span class="icon-trash-o"></span>删除
							</a>
						</td>
					</tr>
			</volist>
	</table>
</div>
</body>
	<script>
		$(document).ready(function(){
			$('.del').click(function(){
				var url = $(this).data('href');
				if(confirm('确认删除')){
					$.get(url,function(data){
						alert('删除成功');
						location.reload();
					});
				}
			});
			$('#branch').change(function(){
				var val = $(this).val();
				if(val != 0){
					location.href = "{:U('Integral/index')}?branch_id="+val;
				}
			});
		});
	</script>

</html>